package com.tongxin.locate;

import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Point;
import com.baidu.mapapi.GeoPoint;
import com.baidu.mapapi.MapView;
import com.baidu.mapapi.Overlay;

public class PointOverlay extends Overlay
{
	    GeoPoint geoPoint; 
	    Paint paint = new Paint();
	    float ax,ay;
	    
	    public PointOverlay(double ax,double ay)
	    {
	    	this.ax=(float)ax;
	    	this.ay=(float)ay;
	    	
	    	geoPoint= new GeoPoint((int) (ax * 1E6),(int)(ay * 1E6));
	    }
	    
	    public void draw(Canvas canvas, MapView mapView, boolean shadow) 
	    {
	    	Point point = mapView.getProjection().toPixels(geoPoint, null);
	    	
	    	paint.setColor(Color.RED);
	    	paint.setAntiAlias(true);
	    	canvas.drawCircle(point.x, point.y, 8, paint);
	    
    }
}
